package tq.com.tqstudent.net.ok;

import android.app.Activity;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.view.Window;

import com.lib.common.views.LoadingDialog;
import com.lzy.okgo.request.base.Request;

/**
 * @Author rames
 * @date 2019/3/8 15:03
 */
public abstract class StringDialogCallback extends StringCallback {
    private Dialog dialog;

    public StringDialogCallback(Activity activity) {
        dialog = new LoadingDialog(activity);
    }

    @Override
    public void onStart(Request<String, ? extends Request> request) {
        if (dialog != null && !dialog.isShowing()) {
            dialog.show();
        }
    }

    @Override
    public void onFinish() {
        if (dialog != null && dialog.isShowing()) {
            dialog.dismiss();
        }
    }
}